package com.googlecode.yadic;

import com.googlecode.totallylazy.Callable1;
import com.googlecode.totallylazy.Option;
import com.googlecode.totallylazy.Pair;

import java.lang.reflect.Type;

public interface TypeMap extends Callable1<Type, Object>, Creator {
    TypeMap addType(Type type, Callable1<Type, ?> resolver);

    TypeMap addType(Type type, Class<? extends Callable1> resolverClass);

    TypeMap addType(Type type, Type concrete);

    <T> Callable1<Type, T> getResolver(Type type);

    <T> Pair<? extends TypeMap, Option<Callable1<Type, T>>> remove(Type type);

    boolean contains(Type type);

    TypeMap decorateType(Type anInterface, Type concrete);
}
